package core.compagnie;

import core.voyageur.Client;

public class TypeCarteFidelite {

	private CompAerienne compagnie;
	private MetaCompagnie metaCompagnie;
	private String type;

	private int reduc;

	/**
	 * @param client
	 * @param compagnie
	 */
	public TypeCarteFidelite(String type, CompAerienne compagnie, int reduc) {
		super();
		this.type = type;
		this.compagnie = compagnie;
		this.metaCompagnie = null;
		this.reduc = reduc;
	}

	/**
	 * @param client
	 * @param metaCompagnie
	 */
	public TypeCarteFidelite(String type, MetaCompagnie metaCompagnie, int reduc) {
		super();
		this.type = type;
		this.metaCompagnie = metaCompagnie;
		this.compagnie = null;
		this.reduc = reduc;
	}

	public TypeCarteFidelite(TypeCarteFidelite t) {
		super();
		this.type = t.type;
		this.metaCompagnie = t.metaCompagnie;
		this.compagnie = t.compagnie;
		this.reduc = t.reduc;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @return the compagnie
	 */
	public CompAerienne getCompagnie() {
		return compagnie;
	}

	/**
	 * @return the metaCompagnie
	 */
	public MetaCompagnie getMetaCompagnie() {
		return metaCompagnie;
	}

	/**
	 * @return the reduc
	 */
	public int getReduc() {
		return reduc;
	}

	public String toString() {
		String res="";
		if(metaCompagnie != null) res += metaCompagnie.getNom();
		else res += compagnie.getNom();
		res += " " + type + " " + reduc +"%";
		return res;
	}

}
